home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / gg / guile-1.4.1.lha / TODO.goops < prev   
Text File  |  2001-03-05  |  7KB  |  197 lines

  1. * Typed slots
  2.  
  3. * Add downstream slot to <generic>
  4.  
  5. * <extended-generic> with upstream slot
  6.  
  7. * (define-extended-generic NAME #:extend GF1 | (list GF2 GF3))
  8.   <=> (define NAME (make-extended-generic GF1 | (list GF2 GF3)))
  9.  
  10. * Change generic-function-methods to take upstream/downstream into account
  11.  
  12. * Ditto for %invalidate-method-cache
  13.  
  14. * Introduce slot option indicating whether to merge slots or not
  15.   default = don't merge
  16.  
  17. * Remove slot-ref/set!
  18.  
  19. * Generate accessor by default.
  20.  
  21. * Option to prevent accessor
  22.  
  23. * Implement apply generic protocol
  24.  
  25. * New class extended-generic with list of generics slot so that we
  26.   refer to generics in other modules instead of copying methods
  27.  
  28. * New special from for definingextending generics and adding methods?
  29.  
  30. * Introduce new syntax (define-method (foo ...) ...)
  31.   Announce old syntax as deprecated.
  32.  
  33. * Extend syntax for `define-generic' so that options can be passed,
  34.   especially the default and setter options.  Then don't let
  35.   define-generic automatically pick up default methods any longer.
  36.  
  37. * Replace compute-get-n-set
  38.  
  39. * Method compilation:
  40.  
  41.   0. expand macros!
  42.   1. accessors --> @slot-ref|set! | proc call
  43.   2. gf --> code-entry | dispatcher
  44.   3. apply gf --> code-entry | dispatcher
  45.   4. next-method call --> code
  46.   5. next-method reference --> add next-method let
  47.  
  48.   6. with-slots: slot reference --> @slot-ref|set! | proc call
  49.   7. with-accessord: accessor ref --> -- " --
  50.  
  51.   The following would be necessary to remove overhead for matrix
  52.   setting in (math matrix):
  53.  
  54.   8. (setter proc) --> proc
  55.   9. (proc exp1 ...) --> proc body if body uses formals once or
  56. exp1 ... are atomic
  57.  
  58.   NOTE: Use slot types if present.
  59.  
  60.   10. Mark values as newly created/input.  (A function is functional
  61.       also if it sets a newly created value.)  Mark procedures as
  62.       functional/imperative.  Call functional procedures at compile
  63.       time if their value is a constant.
  64.  
  65. * scm_slot_SCM in C interfac (make sure that the right mark in the
  66.   layout is set)
  67.  
  68. * Beware of the next-method dispatch problem!
  69.  
  70. * with-slots, with-accessors
  71.  
  72. * Update mop.text
  73.  
  74. * Optimizations
  75.  
  76. ** Remove assumptions of single-symbol slot definitions from goops.c.
  77.  
  78. ** Implement top-sort and compute-std-cpl in C, use this during
  79.    bootstrapping and remove Scheme version of compute-std-cpl in
  80.    goops.scm.
  81.  
  82. ** Don't call intern repeatedly in goops.c (see e.g. CALL_GF).
  83.  
  84. *** Don't forget to invalidate generic function caches
  85. when classes are redefined
  86.  
  87. MDJ 990821 <djurfeldt@nada.kth.se> Why should we do this?
  88.  
  89. ** Strategy for optimization of the MOP
  90.  
  91. Terminology: Let subprotocol F mean a series of generic function calls
  92. that starts with a call to generic function F in the MOP.
  93.  
  94. Ex: The apply-generic is a subprotocol that includes
  95. compute-applicable-methods and sort-applicable-methods.
  96.  
  97. It is possible to have a fairly extensive MOP and yet have an
  98. efficient implementation for the standard case.
  99.  
  100. Currently, this is the case with the apply-generic protocol: The class
  101. <generic> has the flag SCM_CLASSF_PURE_GENERIC set.  Instances of this
  102. class follow an efficient C level implementation of the apply-generic
  103. protocol, but instances to subclasses of <generic> use the Scheme
  104. level protocol.
  105.  
  106. Here is a proposal for a different strategy to achieve the same goal:
  107.  
  108. Let generic functions belonging to a certain subprotocol be instances
  109. to a subclass <SUBPROTOCOL-generic> of <generic>.  The idea is that
  110. the optimized version of the MOP will be used on instances to all
  111. classes which are "pure" with respect the protocol.  The purity is an
  112. inherited property.
  113.  
  114. But, if the user specializes a function M which is an instance of
  115. <SUBPROTOCOL-generic> to C, C will no longer be "pure".
  116.  
  117. Example: Let C be a subclass to <generic>.  Normally a function F
  118. which is an instance of C will be applied using the optimized
  119. apply-generic protocol.  But, if the user specializes
  120. compute-applicable-methods to C, C will no longer be "pure" => F will
  121. be applied using the full MOP.
  122.  
  123. More concretely, we could allocate an inherited class flag which tells
  124. that a GF belongs to SUBPROTOCOL.  There is also a class flag which
  125. tells that a CLASS is "pure" with respect to SUBPROTOCOL.
  126.  
  127. When the user specializes a function F to a class C, add-method! will
  128. clear the purity flag of C if F has the SUBPROTOCOL flag set.
  129.  
  130. This could for example be done by always calling a magic function
  131.  
  132.   %touch F C
  133.  
  134. when specializing F to C in the first argument.
  135.  
  136. It is also necessary to pay attention to the positions of slots so
  137. that instances of "pure" classes have slots on the positions where the
  138. optimized protocols expect to find them.
  139.  
  140. * MOP
  141.  
  142. ** Clean up the MOP with respect to recent changes
  143.  
  144. ** Make no-applicable-method CLOS-like (args)
  145.  
  146. * Misc
  147.  
  148. ** add compile-method to MOP?
  149.  
  150. ** Class-specific slots: Name: (<class-name> <slot-name>)
  151.    (Maybe special metaclass?)
  152.  
  153. I stepped down as GOOPS maintainer since I had the intention to quit
  154. working with Guile development.  But since I've changed my mind,
  155. Christian and I decided that I become GOOPS maintainer again.
  156.  
  157. This means that it is ultimately I and Maciej (since there are plans
  158. to integrate GOOPS with Guile) who ultimately makes decisions about
  159. how to change GOOPS.
  160.  
  161. I'm saying this with the current GOOPS-module system debate in mind,
  162. because I'd like to guarantee you that we won't make any rash
  163. decisions about GOOPS design in this respect.
  164.  
  165. I see the current discussion as a useful play with ideas to elucidate
  166. problems in GOOPS and perhaps come up with useful new ideas.  But I
  167. won't include new ideas into GOOPS until I'm sure it is a good move,
  168. and I can tell you we're very far from that.
  169.  
  170.  
  171. Still, it is my view that GOOPS has to change further in order to be
  172. more adapted to the nature of Scheme.
  173.  
  174. While LISP is "centered around" symbols, Scheme is centered around
  175. objects.  Because of this, the GOOPS MOP will change to also be
  176. centered around objects.  E. g., slots will no longer be identified by
  177. a name, but by a slot definition object.
  178.  
  179. This means that slot-ref/set! *will* be outdated.  (They are going to
  180. be supported in the STklos compatibility module, however.)  I know
  181. that this is a bit controversial, but we have already had a long
  182. discussion about this in the past.  While that discussion didn't end
  183. in consensus, the support for this change was stronger.  After long
  184. consideration, the decision is now made to carry it through.
  185.  
  186. The canonic way of accessing slots is through accessors.  An accessor
  187. is a generic function with setter with get and set methods for a
  188. particular slot specialized to the class carrying the slot.  (This is
  189. what accessors look like already now.)
  190.  
  191. /mdj
  192.  
  193. P.S. I know that several people are now waiting for me to do things.
  194.      Unfortunately this weekend didn't have as much time for Guile as
  195.      I had wished.  I promise to make efforts to get new Guile time as
  196.      soon as possible.
  197.